<template>
  <div>
    <div>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="创建人" prop="createUserId">
          <div>{{ form.createUserId }}</div>
        </el-form-item>
        <el-form-item label="流程名称" prop="flowName">
          <div>{{ form.flowName }}</div>
        </el-form-item>
        <el-form-item label="料单类型" prop="receiptTypeOpt">
          <div>{{ form.receiptTypeOpt }}</div>
        </el-form-item>
        <el-form-item label="学院" prop="collegeOrgId">
          <div>{{ form.collegeOrgId }}</div>
        </el-form-item>
        <el-form-item label="经费项目" prop="fundsItem">
          <div>{{ form.fundsItem }}</div>
        </el-form-item>
        <el-form-item label="资产名称" prop="assetName">
          <div>{{ form.assetName }}</div>
        </el-form-item>
        <el-form-item label="购置日期" prop="purchaseDate">
          <div>{{ form.purchaseDate }}</div>
        </el-form-item>
        <el-form-item label="规格" prop="specs">
          <div>{{ form.specs }}</div>
        </el-form-item>
        <el-form-item label="单价(元)" prop="unitPrice">
          <div>{{ form.unitPrice }}</div>
        </el-form-item>
        <el-form-item label="总价(元)" prop="totalPrice">
          <div>{{ form.totalPrice }}</div>
        </el-form-item>
        <el-form-item label="凭证类型" prop="evidenceTypeOpt">
          <div>{{ form.evidenceTypeOpt }}</div>
        </el-form-item>
        <el-form-item label="收料人员" prop="receiptorId">
          <div>{{ form.receiptorId }}</div>
        </el-form-item>
        <el-form-item label="经办人员" prop="handlingUserId">
          <div>{{ form.handlingUserId }}</div>
        </el-form-item>
        <el-form-item label="发票" prop="invoiceFileId">
          <div>{{ form.invoiceFileId }}</div>
        </el-form-item>
        <el-form-item label="料单价格" prop="materialPrice">
          <div>{{ form.materialPrice }}</div>
        </el-form-item>
        <el-form-item label="实验室" prop="labId">
          <div>{{ form.labId }}</div>
        </el-form-item>
        <el-form-item label="填单日期" prop="fillDate">
          <div>{{ form.fillDate }}</div>
        </el-form-item>
        <el-form-item label="使用方向" prop="expectUseOpt">
          <div>{{ form.expectUseOpt }}</div>
        </el-form-item>
        <el-form-item label="型号" prop="model">
          <div>{{ form.model }}</div>
        </el-form-item>
        <el-form-item label="厂家" prop="manufactor">
          <div>{{ form.manufactor }}</div>
        </el-form-item>
        <el-form-item label="数量" prop="quantity">
          <div>{{ form.quantity }}</div>
        </el-form-item>
        <el-form-item label="原始凭证" prop="originalVoucher">
          <div>{{ form.originalVoucher }}</div>
        </el-form-item>
        <el-form-item label="凭证编号" prop="voucherNo">
          <div>{{ form.voucherNo }}</div>
        </el-form-item>
        <el-form-item label="联系人" prop="contactUser">
          <div>{{ form.contactUser }}</div>
        </el-form-item>
        <el-form-item label="联系人手机" prop="contactMobile">
          <div>{{ form.contactMobile }}</div>
        </el-form-item>
      </el-form>
    </div>
    <div v-for="(historyData, index) in fromData" :key="index">
      <h2>{{ historyData.taskNodeName }}</h2>
      <h3>审批人:{{ historyData.createName }}</h3>
      <h3>审批时间:{{ historyData.createdDate }}</h3>
      <el-form
        v-for="(fistoryFormData, indexH) in historyData.formHistoryDataDTO"
        :key="indexH"
        label-width="80px"
      >
        <el-form-item :label="fistoryFormData.title">
          <div>{{ fistoryFormData.value }}</div>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import { getReceipt_form } from "@/api/labbase/receipt_form";
import { historyFromData } from "@/api/activiti/historyFormdata";
export default {
  name: "receiptFormHistoryForm",
  props: {
    businessKey: {
      type: String,
    },
  },
  data() {
    return {
      // 表单参数
      form: {},
      fromData: [],
    };
  },
  created() {
    this.getReceipt_form();
    this.historyFromData();
  },
  methods: {
    getReceipt_form() {
      getReceipt_form(this.businessKey).then((response) => {
        this.form = response.data;
      });
    },
    historyFromData() {
      historyFromData(this.businessKey).then((response) => {
        this.fromData = response.data;
      });
    },
  },
};
</script>

<style scoped></style>
